#include <stdio.h>

#define MAX 1024

void lower1(char *p)
{
	int i;

	for(i = 0; i < strlen(p); i++){
		if(p[i] >= 'A' && p[i] <= 'Z')
			p[i] +=32;
		printf("%c", p[i]);
	}
}

int main(void)
{
	FILE *fp;
	char buf[MAX];
	int n;

	fp = fopen("article.txt", "r");
	if(fp == NULL) {
		perror("fail to open");
		exit(1);
	}

	while((n = fread(buf, sizeof(char), MAX - 1, fp)) > 0) {

		buf[n] = '\0';
		lower1(buf);
	}

	if(n < 0) {
		perror("fail to read");
		exit(1);
	}

	fclose(fp);

	return 0;
}
